﻿using ProjectCore.Common;
using ProjectCore.Domain.DomainService;
using ProjectCore.Domain.Model.Entity;
using ProjectCore.Domain.Repository.Interfaces;
using ProjectCore.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace ProjectCore.Application
{
    public class AppEval:IAppEval
    {
        private readonly IBaseRepository<Eval> baseRepository;
        private readonly MyContext myContext;
        private readonly IEvalDomainService eval1;
        public AppEval(IBaseRepository<Eval> _baseRepository, MyContext _myContext, IEvalDomainService _eval1)
        {
            baseRepository = _baseRepository;
            myContext = _myContext;
            eval1 = _eval1;
        }


        //反填
        public async Task<Eval> GetEval(int Id)
        {
            return await eval1.GetEval(Id);
        }


        //获取评论集合
        public async Task<HeaderResult<List<Eval>>> GetEvals(int pageIndex, int pageSize)
        {
            return await eval1.GetEvals(pageIndex,pageSize);
        }


        //逻辑删除
        public async Task<int> IsDel(int Id)
        {
            return await eval1.IsDel(Id);
        }


        //修改
        public async Task<int> UptEval(Eval eval)
        {
            return await eval1.UptEval(eval);
        }
    }
}
